from beamsearch_solution import beam_solution
from astar_solution      import astar_solution
from problems            import *
from heuristics          import *
import matplotlib.pyplot as     plt
import matplotlib
from numpy               import arange 

""" 
testing beamsearch one problem, with different beam sizes up to in [beams, beams + 25], for speed, with h = manhattan_dirt
"""

times = []
length = []
beams = 15
start_factor = 1

for beam in xrange(1,beams):
    s_ = beam_solution(manhattan_dirt(),beam+start_factor)
    
    t,s=s_.solve(p3)
    length.append(s)
    times.append(t)
 
plt.ylabel('time/length')
plt.xlabel('#beams')        
#plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')

plt.plot(arange(1,beams),times,arange(1,beams),length)
plt.plot(arange(1,beams)+start_factor,times,'b')
plt.show()




        
    